define(function(require){
	var $ = require("jquery");
	var justep = require("$UI/system/lib/justep");
	
	var Model = function(){
		this.callParent();
	};

	


	Model.prototype.serviceBackClick = function(event){
		this.comp("windowReceiver1").windowEnsure();
		this.getParentModel().goBackCommunity();
	};


	Model.prototype.lifeServiceDataCustomRefresh = function(event){
	   var id = JSON.parse(localStorage.getItem("userInfo")).data[2].id;
	   var url = "http://www.xjzlhy.com:81/ex_community/a/api/community/getNewsByCategoryId?callback=?&category.id=666666";
	   $.getJSON(
			   url,
			    {
				  "office.id":id
				},
			   function(data){
			       console.log(data);
				   event.source.loadData(data.data);
			   }
	   );

	};


	Model.prototype.lifeServiceClick = function(event){
	
		
	  var row = event.bindingContext.$object;
		
		var option = {
				type:"service",
				title:row.val("title"),
				content:row.val("content")
		};
		
		justep.Shell.showPage("$UI/communityOto/community/channel/template.w",option);

	};
	
	
	Model.prototype.onTouchStart = function(event){
	
	     $(event.currentTarget).addClass("touch");

	};
	
	
	
	Model.prototype.onTouchEnd = function(event){
		$(event.currentTarget).removeClass("touch");
	};
	


	return Model;
});